﻿#region Copyright 
/*-------------------------------------------------------------------------
* 命名空间名称/文件名:    SSPivot.Data.Entities/AuditedDeletedEntity 
* CLR版本:     4.0.30319.42000
* 机器名称:    DESKTOP-NHMLO8A
* 功 能：       N/A
* 类 名：       AuditedDeletedEntity
* 创建时间：  2025/5/22 11:53:19
* 版本号：      v1.0
* 创建人:        xulong
*-------------------------------------------------------------------------*/
#endregion
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SSPivot.Data.Entities
{
    public interface IAuditedDeletedEntity:IEntity
    {
        bool IsDeleted { get; set; }
        DateTime? DeletedTime { get; set; }
        long? DeleterId { get; set; }
        string? Deleter { get; set; }
    }
    [Serializable]
    public class AuditedDeletedEntity : IAuditedDeletedEntity
    {
        public virtual bool IsDeleted { get; set; }

        /// <inheritdoc />
        public virtual long? DeleterId { get; set; }
        [MaxLength(50)]
        public virtual string? Deleter { get; set; } 
        public virtual DateTime? DeletedTime { get; set; }
    }
    [Serializable]
    public abstract class AuditedDeletedEntity<TKey> : Entity<TKey>, IAuditedDeletedEntity
    {
        public virtual bool IsDeleted { get; set; }

        /// <inheritdoc />
        public virtual long? DeleterId { get; set; }
        [MaxLength(50)]
        public virtual string? Deleter { get; set; }
        public virtual DateTime? DeletedTime { get; set; }
    }
}
